package structure.decorator;

import structure.decorator.decorators.obj.Milk;
import structure.decorator.decorators.obj.Suger;
import structure.decorator.toBeDecorated.controller.Drink;
import structure.decorator.toBeDecorated.obj.LongBlack;

public class User {
    public static void main(String[] args) {
        // 1. 点一份long black
        Drink order = new LongBlack();
        System.out.println(order.getDes() + ", cost=" + order.cost());

        // 2. 加一份牛奶
        order = new Milk(order);
        System.out.println(order.getDes() + ", cost=" + order.cost());

        // 3. 加一份糖
        order = new Suger(order);
        System.out.println(order.getDes() + ", cost=" + order.cost());

        // 4. 我再加一份糖，嘿嘿
        order = new Suger(order);
        System.out.println(order.getDes() + ", cost=" + order.cost());
    }
}
